﻿@*@model IEnumerable<SDE_FIC.Models.Curso>*@
@model PagedList.IPagedList<SDE_FIC.Models.Curso>
@using PagedList.Mvc
<link href="~/Content/PagedList.css" rel="stylesheet" type="text/css" />
@{
    ViewBag.Title = "Curso";
    Layout = "~/Views/Shared/_Layout_Sistema.cshtml";
}

<h2>@ViewBag.Title</h2>

<p>
    @Html.ActionLink("Novo Curso", "Create")
</p>
<table class="table table-bordered table-hover">
    <thead>
    <tr>
        <th>
            Nome do Curso
        </th>
        <th>
            Descrição
        </th>
        <th>
            C. Horária (h)
        </th>
        <th>Ação</th>
    </tr>

    </thead>
@foreach (var item in Model) {
    <tbody>
    <tr>
        <td width="400px">
            @Html.DisplayFor(modelItem => item.CursoNome)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Descricao)

        </td>
        <td style="text-align:center; width:100px">
            @Html.DisplayFor(modelItem => item.CargaHoraria)
        </td>
        <td style="text-align:center;">
            <a href="@Url.Action("Edit", "Curso", new { id = item.IdCurso })"><img src="~/Content/img/editar.png" alt="Editar"/></a>
            <a href="@Url.Action("Details", "Curso", new { id=item.IdCurso })"><img src="~/Content/img/detalhes.png" alt="Detalhes"/></a>
            <a href="@Url.Action("Delete", "Curso", new { id = item.IdCurso })"><img src="~/Content/img/excluir.png" alt="Excluir"/></a>
        </td>
    </tr>
   </tbody>
}

</table>
<div style="font-size:8pt;width:100%;text-align:right;" >
@Html.PagedListPager(Model, page => Url.Action("Index", new {pagina = page}))
</div>